<template>
<div id="app">
    <router-view />
</div>
</template>

<script>
export default {
    name: 'app',
    created(){
        // console.log('****router',this.$route.query)
        var info = this.$route.query;
        this.$store.commit("setUserInfo", info)
        let ua = window.navigator.userAgent.toLowerCase()
        if (ua.match(/MicroMessenger/i) == 'micromessenger') {
            //   判断是微信环境，继续判断是否为小程序
            wx.miniProgram.getEnv((res)=>{
                console.log('res.miniprogram:',res.miniprogram)
                if (res.miniprogram) {
                    this.$store.commit('setIsWeiXin',true)
                } else {
                    this.$store.commit('setIsWeiXin',false)
                }
            })
        } else {
            //非微信环境，返回false
            this.$store.commit('setIsWeiXin',false)
        }

    }
}
</script>

<style lang="scss">
* {
    padding: 0;
    margin: 0;
    box-sizing: border-box;
}

html,
body {
    height: 100%;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

body {
    overflow: hidden;
}
.custom-avator{
    /* width: 70px;
    height: 70px; */
    width: 0.7rem;
    height: 0.7rem;
    background: url('./assets/user-bg.png') no-repeat center;
    background-size: cover;
    position: relative;
}
.custom-avator .avator{
    width: 0.46rem;
    height: 0.46rem;
    position: absolute;
    top: 4px;
    left: 0;
    right: 0;
    margin: auto;
    border-radius: 50%;
}
@media screen and (min-width: 320px) {
    html {
        font-size: 42.5px;
    }
}

@media screen and (min-width: 360px) {
    html {
        font-size: 48px;
    }
}

@media screen and (min-width: 400px) {
    html {
        font-size: 53px;
    }
}

@media screen and (min-width: 440px) {
    html {
        font-size: 58.5px;
    }
}

@media screen and (min-width: 480px) {
    html {
        font-size: 64px;
    }
}

@media screen and (min-width: 640px) {
    html {
        font-size: 85px;
    }
}

html {
    font-size: 13.33vw;
}

@media screen and (min-width: 750px) {
    html {
        font-size: 100px;
    }
}

#app {
    font-family: "Avenir", Helvetica, Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-align: center;
    color: #2c3e50;
}
/* 自定义点图片 */
.amap-icon {
    z-index: 3;
}
.amap-icon img {
    width: 100%;
    height: 100%;
}
.amap-marker-label {
    line-height: 1;
    border: none;
    background: #e4e4e4;
    border-radius: 0.06rem;
    padding: 0.12rem 0.22rem;
}
.show-box-tips {
    position: absolute;
    width: 0.62rem;
    height: 0.62rem;
    left: -1.19rem;
    top: -0.72rem;
    // 动画
    animation: bounce 1s ease;
    transform-origin: center bottom;
}
@keyframes bounce {
    from,
    20%,
    53%,
    80%,
    to {
        -webkit-animation-timing-function: cubic-bezier(0.215, 0.61, 0.355, 1);
        animation-timing-function: cubic-bezier(0.215, 0.61, 0.355, 1);
        -webkit-transform: translate3d(0, 0, 0);
        transform: translate3d(0, 0, 0);
    }

    40%,
    43% {
        -webkit-animation-timing-function: cubic-bezier(0.755, 0.05, 0.855, 0.06);
        animation-timing-function: cubic-bezier(0.755, 0.05, 0.855, 0.06);
        -webkit-transform: translate3d(0, -30px, 0);
        transform: translate3d(0, -30px, 0);
    }

    70% {
        -webkit-animation-timing-function: cubic-bezier(0.755, 0.05, 0.855, 0.06);
        animation-timing-function: cubic-bezier(0.755, 0.05, 0.855, 0.06);
        -webkit-transform: translate3d(0, -15px, 0);
        transform: translate3d(0, -15px, 0);
    }

    90% {
        -webkit-transform: translate3d(0, -4px, 0);
        transform: translate3d(0, -4px, 0);
    }
}
</style>
